package com.ciaojian.client.util;

import java.math.BigInteger;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class GenerateOrderNum {

    public static String build(Integer store, String rankNo) {
        Date date = new Date();
        DateFormat format = new SimpleDateFormat("yyyyMMdd");
        String time = format.format(date);
        //生成五位随机数
        Random random = new Random();
        int fiveRandom = random.nextInt(99999) % (99999 - 10000 + 1) + 10000;
        return time + store + rankNo + fiveRandom;
    }


    public static BigInteger build2(){
        Date date = new Date();
        DateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
        //生成五位随机数
        int fiveRandom = new Random().nextInt(99999) % (99999 - 10000 + 1) + 10000;
        return new BigInteger(format.format(date)+fiveRandom);
    }

}
